package kr.hkit.androidcomplete01.ch08;

import kr.hkit.androidcomplete01.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

//390 fruit2로 수정요
public class Fruit extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch08_fruit);
		
		Button btnApple = (Button) findViewById(R.id.apple);
		btnApple.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				TextView textFruit = (TextView) findViewById(R.id.fruit);
				textFruit.setText("Apple");
			}
		});
		
		Button btnOrange = (Button) findViewById(R.id.orange);
		btnOrange.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				TextView textFruit = (TextView) findViewById(R.id.fruit);
				textFruit.setText("Orange");
			}
		});
		
		
	}
}
